/*
 * @Title: 验证码
 * @Created by: gsjPC 
 */
<template>
	<view class="regWrap">
		<comHeader :config="navConfig"/>
		<view class="yzmMarTop">
			<view class="yzmIphone">
				<text>我们已经发送了验证码到你的手机：</text>
				<text>15512314322</text>
			</view>
			
			<view class="yzmCon">
				<wakary-input 
				:maxlength="maxlength" 
				:isPwd="isPwd"
				:goUrlIndex="goUrlIndex"
				type="bottom"/>
			</view>
			<view class="Downminus">{{count}}秒</view>
			<view class="changeLog" @tap="togglePopup('bottom','share')">换个方式登录</view>
		</view>
		<!-- 底部弹窗 -->
		<uni-popup ref="share" :type="type" :custom="true">
			<view class="uni-share">
				<view class="uni-share-content">
					<view 
					v-for="(item, index) in bottomData" 
					:key="index" 
					class="uni-share-content-box"
					@tap="goLog(item.logurl)">
						<view class="uni-share-content-text">{{ item.text }}</view>
					</view>
				</view>
				<view class="uni-share-btn" @click="cancel('share')">取消登陆</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import wakaryInput from '@/components/wakary-input/wakary-input'
	 import uniPopup from '@/components/uni-popup/uni-popup.vue'
	export default{
		components:{
			wakaryInput,
			uniPopup
		},
		data(){
			return{
				navConfig:{
					isFixed: false, //是否absolute布局
					left: {
						isShowLeft: true,
						leftGobackColor: 'black', //左边返回icon颜色
					},
					mid: {
						isShowMid: true,
						text: '输入验证码',
						textColor: '#000',
						isShowIco:false,
						ico:'',
						icoColor:''
						
					},
					right: {
						text: '',
						textColor: '',
						isShowRight: false,
						ico: '', //右侧图标地址
						isShowRightIco: false ,//是否显示右侧图标
						ico2: '', //右侧第二个图标地址
						isShowRightIco2: false //是否显示右侧第二个图标
					}
				},
				maxlength:4,
				isPwd:false,
				count:34,
				type: '',
				goUrlIndex:3,//验证码参数
				bottomData:[
					 {
						 text:'短信验证码登录',
						 name:'message',
						 logurl:'/pages/login/yzm'
					 },
					 {
						 text:'密码登录',
						 name:'psd',
						 logurl:'/pages/login/psdLog'
					 }
				 ],
			}
		},
		methods:{
			togglePopup(type, open) {
				this.type = type
				this.$refs[open].open()
			},
			cancel(type) {
				this.$refs[type].close()
			},
			goLog(logurl){
				uni.navigateTo({
					url:logurl
				})
			}
		}
	}
</script>

<style>
	.regWrap{
		margin:0 72upx;
	}
	.yzmMarTop{
		margin-top: 94upx;
	}
	.yzmCon{
		margin-top: 80upx;
	}
	.yzmIphone{
		text-align: center;
		padding-top:94upx;
	}
	.yzmIphone text:first-child{
		color: #666666;
		font-size:28upx;
	}
	.yzmIphone text:last-child{
		display: block;
		color: #333333;
		font-size: 36upx;
		margin-top: 36upx;
	}
	.Downminus{
		color: #666666;
		font-size: 28upx;
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
		margin-top:44upx;
		}
	.changeLog{
		margin-top:120upx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		color: #549AFF;
		font-size: 28upx;
	}
	
	/* 底部分享 */
	.uni-share {
		background: #fff;
		border-top-left-radius: 20upx;
		border-top-right-radius:20upx;
	}
	
	.uni-share-title {
		line-height: 60upx;
		font-size: 24upx;
		padding: 15upx 0;
		text-align: center;
	}
	
	.uni-share-content {
		display: flex;
		flex-wrap: wrap;
	}
	
	.uni-share-content-box {
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 100%;
		box-sizing: border-box;
		line-height:98upx;
		border-bottom: 1upx solid #ECEBEB;
	}
	.uni-share-content-box:last-child{
		border-bottom:0
	}
	.uni-share-content-image {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 60upx;
		height: 60upx;
		overflow: hidden;
		border-radius: 10upx;
	}
	
	.uni-share-content-image .image {
		width: 100%;
		height: 100%;
	}
	
	.uni-share-content-text {
		font-size: 26upx;
		color: #333;
		padding-top: 5px;
		padding-bottom: 10px;
	}
	
	.uni-share-btn {
		height: 95upx;
		line-height: 90upx;
		border-top: 10px #ECEBEB solid;
		text-align: center;
		color: #333333;
		font-size: 28upx;
	}
</style>
